<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateLeaveMsgTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('leave_msg', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string("title")->comment("主题");
            $table->bigInteger("user_id")->comment("用户id");
            $table->text("content")->comment("内容")->nullable();
            $table->boolean("is_read")->comment("是否已读")->default(false);
        });
        DB::statement("ALTER TABLE `leave_msg` comment'客户留言表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('leave_msg');
    }
}
